<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>分页界面</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
</head>
<body>
<!--<style>-->
    <!--.layui-table-cell{-->
        <!--display:table-cell;-->
        <!--vertical-align: middle;-->
    <!--}-->
    <!--.layui-table-view{height: 350px!important;}-->
<!--</style>-->
<div class="wrap-container clearfix">
    <div class="column-content-detail">
        <form class="layui-form">
        <div class="search-cont clearfix" id="tool">
            <div class="operation-btn-cont">
                <!--<input type="hidden" name="applyId" value="${applyId}" />-->
                <input type="hidden" name="association" id="association"/>
                <div class="operright cyt-retract-close hideMenu"> 收起筛选<i class="iconfont">&#xe658;</i></div>
                <div class="operright cyt-retract-open showMenu" style="display: none;"> 展开筛选<i class="iconfont">&#xe936;</i></div>
                <div class="triangle-bottom"></div>
                <div class="triangle-top"></div>
            </div>
            <div class="search-details">
                <div class="layui-form-item marb5">
                    <!--search开始-->
                    <div class="layui-inline">
                        <label class="layui-form-label">社团名称：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="title" placeholder="请输入社团名称" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <!--search结束-->
                    <div class="layui-inline marl8">
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="seacherBtn">搜索</button>
                        <button class="layui-btn layui-btn-normal" type="reset">重置</button>
                    </div>
                </div>
            </div>
        </div>
        <!--<div class="layui-form" id="table-list">-->
            <!--<table id="entityList" lay-filter="entityList" class="cy-list-table"></table>-->
        <!--</div>-->
        <div class="layui-form" id="table-list">
            <table id="entityList" lay-filter="entityList" class="cy-list-table"></table>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block" style="margin-left: 0px !important;text-align: center; margin-top: 20px;">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn" id="btnAdd" >保存</button>
                <button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
                <button type="button" style="display: none;" id="save" class="layui-btn layui-btn-primary"></button>
            </div>
        </div>
        </form>
    </div>
</div>
<!--操作-->
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/html" id="ty"></script>
<script>
    var applyId='${applyId}';
    var selectIds='${selectIds}';
    var tableIns = null;

    layui.use(['jquery', 'table', 'layer', 'page', 'dialog', 'baseutil'], function () {
        var $ = layui.jquery,
            page = layui.page,
            table = layui.table,
            dialog = layui.dialog;

            var url = "/work/association/wxassociation/page?applyId="+applyId+"&selectIds="+selectIds;
            var cols = [
                {type: 'checkbox', fixed: 'left'},
                {field: 'title', title: '社团名称', align: 'center'},
                {field: 'userName', title: '指导老师', align: 'center',template:'#ty'},
            ];
            tableIns = page.initDate(cols, url);

        $("#btnAdd").click(function () {
            var data = table.checkStatus('entityList').data;
            var ids = [];
            for (var i = 0; i < data.length; i++) {
                ids.push(data[i].id)
            }
            if (ids.length > 0) {
                $("#association").val(ids.join(","));
                $("#save").click();
            } else {
                dialog.msg("请添加社团！");
            }
        });






    });
</script>
</body>
</html>